package com.tony.guice;

import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.tony.guice.Common.BillingService;
import com.tony.guice.Common.TransactionLog;
import com.tony.guice.LinkBind.TonyModule;

/**
 * @version V1.0  </br>
 * @ClassName TestGuice </br>
 * @Description TODO  </br>
 * @Author tonywang</br>
 * @DATE 2/28/2019 3:43 PM</br>
 */
public class TestGuice {
    public static void main(String[] args){
        Injector injector = Guice.createInjector(new TonyModule());
        TransactionLog transactionLog= injector.getInstance(TransactionLog.class);//会使用 DataTransactionLog 替代 TransactionLog
        transactionLog.log();
        injector.getInstance(BillingService.class);
    }
}
